<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="http://www.xyshopping.com:8848/qianduan/resources/css/back.css" />
		<script src="http://www.xyshopping.com:8848/qianduan/resources/js/jquery-1.11.3.min.js" type="text/javascript"></script>
		<script type="text/javascript" src="http://www.xyshopping.com:8848/qianduan/resources/js/jquery-heima-0.0.1.js" ></script>
	</head>
	<script>
		$(function(){
			$("#save").click(function(){
				//获取分类名称输入框的属性值
				var cname = $("#cname").val();
				HM.ajax("/category?md=add","cname="+cname,function(vo){
					//服务器响应成功，跳转到列表页面
					if(vo.code == 1){
						location.href = "list.html";
					}else{
						//提示错误信息
						$("#cname_error").html(vo.data).css("color","red");
					}
				})
			})
		})
	</script>
	<body>
		<form action="#" method="post">
			<table cellSpacing="1" cellPadding="5" width="100%" align="center" bgColor="#eeeeee" style="border: 1px solid #8ba7e3" border="0">
				<tr>
					<td class="ta_01" align="center" bgColor="#afd1f3" colSpan="4" height="26">
						<STRONG>添加分类</STRONG>
					</td>
				</tr>
				<tr>
					<td width="18%" align="center" bgColor="#f5fafe" class="ta_01">
						分类名称：
					</td>
					<td class="ta_01" bgColor="#ffffff" colspan="3">
						<input type="text" name="cname" value="" id="cname" class="bg" />
						<span id="cname_error"></span>
					</td>
				</tr>

				<tr>
					<td class="ta_01" style="WIDTH: 100%" align="center" bgColor="#f5fafe" colSpan="4">
						<button type="button" id="save" >
							&#30830;&#23450;
						</button>
						<FONT face="宋体">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT>
						<button type="reset" value="重置">&#37325;&#32622;</button>

						<FONT face="宋体">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT>
						<INPUT  type="button" onclick="history.go(-1)" value="返回" />
					</td>
				</tr>
			</table>
		</form>
	</body>

</html>